<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png" />
    <HelloWorld msg="Welcome to Your Vue.js App" />

    <component-a text="调用全局组件 A"></component-a>

    <component-b text="调用全局组件 B"></component-b>

    <BlogPost post-title="hello1" />

    <BlogPost v-bind:post-title="post.title" />
    <BlogPost v-bind:post-title="post.title + ' by ' + post.author.name" />
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'

// * 导入 ComponentB
import ComponentB from './components/ComponentB.vue'

import BlogPost from './components/BlogPost.vue'

export default {
  name: 'App',
  components: {
    HelloWorld,
    // * 注册 ComponentB
    ComponentB,
    BlogPost
  },
  data() {
    return {
      post: {
        title: 'My journey with Vue',
        author: {
          name: 'someone'
        }
      }
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
